-- 配置 lualine 模块
-- vim.g.gitblame_display_virtual_text = 0 -- Disable virtual text
local git_blame = require('gitblame')

return {
    {
        'nvim-lualine/lualine.nvim',
        config = function()
            require('lualine').setup({
                sections = {
                    lualine_c = {
                        {
                            git_blame.get_current_blame_text,
                            cond = git_blame.is_blame_text_available,
                        }
                    }
                },
                options = {
                    icons_enabled = true,
                    theme = "auto",
                    component_separators = {left = "", right = ""},
                    section_separators = {left = "", right = ""},
                    disabled_filetypes = {},
                    always_divide_middle = true
                },
                sections = {
                    lualine_a = {"mode"},
                    lualine_b = {
                        "branch",
                        "diff"
                        --{"diagnostics", sources = {"nvim_lsp"}}
                    },
                    lualine_c = {"filename"},
                    lualine_x = {
                        {"diagnostics", sources = {"nvim_lsp"}, symbols = {error = " ", warn = " ", info = " ", hint = " "}},
                        "encoding",
                        "fileformat",
                        "filetype"
                    },
                    lualine_y = {"progress"},
                    lualine_z = {"location"}
                },
                inactive_sections = {
                    lualine_a = {},
                    lualine_b = {},
                    lualine_c = {"filename"},
                    lualine_x = {"location"},
                    lualine_y = {},
                    lualine_z = {}
                },
                tabline = {},
                extensions = {}
            })
        end
    }
}
